/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package py.una.pol.ii.is2.domain.flota;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author markos
 */
@Embeddable
public class VehiculoCaracteristicaPK implements Serializable {
    private static final long serialVersionUID = 8552896751289357235L;
    @Basic(optional = false)
    @Column(name = "veca_cod_vehiculo")
    private Integer vecaCodVehiculo;
    @Basic(optional = false)
    @Column(name = "veca_cod_caracteristica")
    private Integer vecaCodCaracteristica;
    
    public VehiculoCaracteristicaPK() {
    }

    public VehiculoCaracteristicaPK(Integer vecaCodVehiculo, Integer vecaCodCaracteristica) {
        this.vecaCodVehiculo = vecaCodVehiculo;
        this.vecaCodCaracteristica = vecaCodCaracteristica;
    }

    public int getVecaCodVehiculo() {
        return vecaCodVehiculo;
    }

    public void setVecaCodVehiculo(Integer vecaCodVehiculo) {
        this.vecaCodVehiculo = vecaCodVehiculo;
    }

    public Integer getVecaCodCaracteristica() {
        return vecaCodCaracteristica;
    }

    public void setVecaCodCaracteristica(Integer vecaCodCaracteristica) {
        this.vecaCodCaracteristica = vecaCodCaracteristica;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) vecaCodVehiculo;
        hash += (vecaCodCaracteristica != null ? vecaCodCaracteristica.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof VehiculoCaracteristicaPK)) {
            return false;
        }
        VehiculoCaracteristicaPK other = (VehiculoCaracteristicaPK) object;
        if (this.vecaCodVehiculo != other.vecaCodVehiculo) {
            return false;
        }
        if ((this.vecaCodCaracteristica == null && other.vecaCodCaracteristica != null) || (this.vecaCodCaracteristica != null && !this.vecaCodCaracteristica.equals(other.vecaCodCaracteristica))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.una.pol.ii.is2.dao.flota.VehiculoCaracteristicaPK[vecaCodVehiculo=" + vecaCodVehiculo + ", vecaCodCaracteristica=" + vecaCodCaracteristica + "]";
    }   
}